package com.ruoyi.data.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.data.service.DataQikeService;
import com.ruoyi.data.vo.QikeUrl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/data/qike")
public class DataQikeController extends BaseController {

  @Resource
  private DataQikeService dataQikeService;

  @GetMapping("/url/{moduleName}")
  public AjaxResult url(@PathVariable("moduleName") String moduleName){
    return AjaxResult.success("ok", new QikeUrl().setUrl(dataQikeService.getUrl(moduleName)));
  }
}
